package cn.funnyxb.powerremember.pullMsg;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.os.AsyncTask;
import android.webkit.WebView;
import cn.funnyxb.powerremember.LogoActivity;
import cn.funnyxb.powerremember.pullMsg.beans.WebMsg;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.AbstractProccessor;
import cn.funnyxb.tools.appFrame.activityFrame.ActivitysHolder;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;

public class PullTask4Webmsg extends AsyncTask<Void, Void, WebMsg>
{
  private Context context;
  private AbstractProccessor proccessor;

  public PullTask4Webmsg(Context paramContext, AbstractProccessor paramAbstractProccessor)
  {
    this.context = paramContext;
    this.proccessor = paramAbstractProccessor;
  }

  private void log(String paramString)
  {
    Debuger.log("pullWebmsg", paramString);
  }

  private void notifyWebMsg(WebMsg paramWebMsg)
  {
    if (paramWebMsg == null);
    while (true)
    {
      return;
      Activity localActivity = App.getApp().getActivitysHolder().getCurrentAcitivity();
      String str1 = paramWebMsg.getButtonUrl();
      boolean bool = localActivity instanceof LogoActivity;
      if (bool)
        ((LogoActivity)localActivity).notifyShowWebMsgDialog(paramWebMsg);
      log("pull,current=" + localActivity + ",isFinishing=" + localActivity.isFinishing() + ", isRestricted=" + localActivity.isRestricted() + ",hasfocus=" + localActivity.hasWindowFocus());
      if ((paramWebMsg == null) || (localActivity.isFinishing()) || (localActivity.isRestricted()))
        continue;
      WebView localWebView = new WebView(localActivity);
      localWebView.loadDataWithBaseURL(null, paramWebMsg.getMsgHtml(), "text/html", "utf-8", null);
      AlertDialog.Builder localBuilder = new AlertDialog.Builder(localActivity).setTitle(paramWebMsg.getTitle()).setView(localWebView).setCancelable(false);
      String str2 = paramWebMsg.getButtonTitle();
      String str3 = paramWebMsg.getButtonUrl();
      if ((str2 != null) && (str3 != null))
        localBuilder.setPositiveButton(paramWebMsg.getButtonTitle(), new 1(this, str1, localActivity));
      localBuilder.setNegativeButton(2131034134, new 2(this, bool, localActivity));
      localBuilder.create().show();
      WebMsg.setLastReaded(App.getApp(), paramWebMsg.getId());
    }
  }

  protected WebMsg doInBackground(Void[] paramArrayOfVoid)
  {
    this.proccessor.regAsyncTask(this);
    WebMsg localWebMsg = new ServerMsger(this.context).getWebMsg();
    log("?webMsg=" + localWebMsg);
    return localWebMsg;
  }

  protected void onPostExecute(WebMsg paramWebMsg)
  {
    super.onPostExecute(paramWebMsg);
    if (paramWebMsg == null);
    while (true)
    {
      return;
      if (WebMsg.getLastShowedId(this.context) < paramWebMsg.getId())
        notifyWebMsg(paramWebMsg);
      this.proccessor.unRegAsyncTask(this);
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.pullMsg.PullTask4Webmsg
 * JD-Core Version:    0.5.3
 */